<%= error_messages_for 'article' %>
<% @style = has_excerpt? ? "" : "display:none" %>
<!-- begin required fields -->
<div class="group">
  <dl>
    <dt><label for="article_title">Title</label></dt>
    <dd><%= form.text_field :title, :class => 'big'  %></dd>
    <dt id="x-lbl" style="<%= @style %>"><%= form.label_for :excerpt %> <span class="hint">(<%= link_to_function 'Hide', %(['x-lbl', 'x-body'].each(Element.toggle)) %>)</span></dt>
    <dd id="x-body" style="<%= @style %>"><%= form.text_area :excerpt, :rows => '8', :class => 'fat'  %></dd>
    <dt><label for="article_body">Write your article</label> <span class="hint">(<%= link_to_function 'Add an excerpt', %(['x-lbl', 'x-body'].each(Element.toggle)) %>)</span></dt>
    <dd><%= form.text_area :body, :class => 'fat', :rows => 25  %></dd>
    <dt><label for="article_tag">Tags</label> <span class="hint">Enter one or more tags separated by a comma or a space (for example, <em>"Web Dev" Tutorials</em> or <em>Web Dev, Tutorials</em>).</span></dt>
    <dd><%= form.text_field :tag %></dd>
  </dl>
</div>
<!-- /end required fields -->

<!-- begin optional fields -->
<dl id="article-optional">
  <dt><label for="article-draft">Save as Draft?</label></dt>
  <dd><label><%= check_box_tag :draft, '1', !@article.new_record? && !@published, :id => 'article-draft' %> Yes, save this article as a draft.</label></dd>
  <dt id="publish-date-lbl"<%= %( style="display:none") unless @article.new_record? || @published -%>><%= label_tag 'article_created_at', 'Publish on this date:' %></dt>
  <dd id="publish-date"<%= %( style="display:none") unless @article.new_record? || @published -%>>
    <%= form.datetime_select :published_at, 
          :start_year => (@article.published_at || Time.now.utc).year-1, :end_year => (Time.now.utc.year + 5), :order => [:month, :day, :year] %>
  </dd>
</dl>
<!-- /end optional fields -->
